<template>
  <div><div id="epub" /></div>
</template>

<script>
import Epub from 'epubjs';
export default {
  props: {
    file: {
      type: Object,
      required: true
    },
    preview: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      fileurl: this.file ? this.file.fileurl : ''
    };
  },
  mounted() {
    var book = Epub(this.fileurl);
    var rendition = book.renderTo('epub', { width: 600, height: 400 });
    rendition.display();
    // var displayed =
  }
};
</script>

<style></style>
